<extend name="./Application/Admin/View/base.html" />
<block name="title"><title><?php echo C(APP_NAME);?>PC端管理</title></block>
<block name="stylesheets">
<link href="__PUBLIC__/assets/css/select2.css" rel="stylesheet">

</block>
<block name="stylecss">
<style type='text/css'>
    table tr td{
        width: 80%;
    }
    table tr th{
        width: 16%;
        text-align: center;
        vertical-align: middle!important;
    }
</style>
</block>
<block name="smallmenu">
<ul class="breadcrumb">
	<li>
		<i class="ace-icon fa fa-home home-icon"></i>
		<a href="{:U('Index/index')}">主页</a>
	</li>
    <li>
		<a href="{:U('Audio/index')}">音频列表</a>
	</li>
	<li class="active">添加音频信息</li>
</ul><!-- /.breadcrumb -->

<!-- #section:basics/content.searchbox -->
<div class="nav-search" id="nav-search"></div><!-- /.nav-search -->
</block>
<block name="content">
<form action="__CONTROLLER__/audio_add" method='post' id='myformedit' class="myformedit" enctype="multipart/form-data">
<input type="hidden" name="action" value="audio_add_action">
<div class="row" style="margin-bottom:7px">
    <div class="col-xs-12"><span class="label label-success"><i class="ace-icon fa fa-user bigger-120"></i> 音频信息</span></div>
</div>
<table class="table table-striped table-bordered table-hover" >
    <tr>
        <th>音频名称</th>
        <td><input type="text" name='audio_name' class="col-xs-6 ninputxt">
        <span class="Validform_checktip">必填项</span>
        </td>
    </tr>
    <tr>
        <th>专业</th>
        <td><select name="audio_major_id" id="" class="col-xs-6">
            <option value="">-请选择-</option>
            <option value="1">电吉他</option>
            <option value="2">爵士鼓</option>
            <option value="3">电贝司</option>
        </select>
        <span class="Validform_checktip">必选项</span>
        </td>
    </tr>
    <tr>
        <th>等级</th>
        <td><select name="audio_level" id="" class="col-xs-6">
            <option value="">-请选择-</option>
            <option value="1">1级</option>
            <option value="2">2级</option>
            <option value="3">3级</option>
            <option value="4">4级</option>
            <option value="5">5级</option>
            <option value="6">6级</option>
            <option value="7">7级</option>
            <option value="8">8级</option>
            <option value="9">9级</option>
        </select>
        <span class="Validform_checktip">必选项</span>
        </td>
    </tr>
  <!--   <tr>
        <th>音频图标</th>
        <td>
        	<div class="col-xs-6">
            <div class="nfile_imgbox" >
                <input type="file" class="nfile" id="file_upload" name="audio_icon" />
                <img src="__PUBLIC__/assets/images/addfile.png" id="preview">
                <a class="nimg_style">+<img src=""> </a>
            </div>
            </div>
            <span class="Validform_checktip">必填项</span>
        </td>
    </tr>
    <tr>
        <th>音频封面图</th>
        <td>
        	<div class="col-xs-6">
            <div class="nfile_imgbox" >
                <input type="file" class="nfile" id="file_upload1" name="audio_pic" />
                <img src="__PUBLIC__/assets/images/addfile.png" id="preview1">
                <a class="nimg_style">+<img src=""> </a>
            </div>
            </div>
            <span class="Validform_checktip">必填项</span>
        </td>
    </tr> -->
    <tr>
        <th>音频（原声）</th>
        <td>
            <div class="naudio_cmt" style="display: inline;">
                <audio class="naudio" preload="preload" controls="" style="display: none;"></audio>
                <div class="naudio_box">
                    <input class="naudio_test " type="file" multiple="multiple" name="audio_file1" value=""/>
                </div>
            </div>
            <span class="Validform_checktip">必填项</span>
        </td>
    </tr>
    <tr>
        <th>音频（伴奏1）</th>
        <td>
            <div class="naudio_cmt " style="display: inline;">
                <audio class="naudio" preload="preload" controls="" style="display: none;"></audio>
                <div class="naudio_box">
                    <input class="naudio_test" type="file" multiple="multiple" name="audio_file2" value=""/>
                </div>
            </div>
            <!-- <span class="Validform_checktip">必填项</span> -->
        </td>
    </tr>
    <tr>
        <th>音频（伴奏2）</th>
        <td>
            <div class="naudio_cmt" style="display: inline;">
                <audio class="naudio" preload="preload" controls="" style="display: none;"></audio>
                <div class="naudio_box">
                    <input class="naudio_test" type="file" multiple="multiple" name="audio_file3" value=""/>
                </div>
            </div>
            <!-- <span class="Validform_checktip">必填项</span> -->
        </td>
    </tr>
    <tr>
        <th>音频简介</th>
        <td><textarea name='audio_introduction' cols='60' rows='8' class="col-xs-6 ninputxt"></textarea>
        	<span class="Validform_checktip">必填项</span>

        </td>
    </tr>
    <tr>
        <td colspan="2"><button type="submit" class="btn btn-primary" >提交</button> <span class="btn" onClick="location.href='{:U('Audio/index')}'">返回</span></td>
    </tr>
</table>
</form>
</block>
<block name="scripts">
<script src="__PUBLIC__/assets/js/select2.js"></script>
</block>
<block name="jscript">
<script script="text/javascript">
    $(function(){
        $('#menu_data').addClass('active open');
        $('#menu_audio_list').addClass('active');
    });
</script>
<script>
    $(function () {
        $(".naudio_test").change(function () {
            var objUrl = getObjectURL(this.files[0]);
            $(this).parent().prev('.naudio').attr("src", objUrl);
            $(this).parent().prev('.naudio').show();
        });
    });
    function getObjectURL(file) {
        var url = null;
        if (window.createObjectURL != undefined) { // basic
            url = window.createObjectURL(file);
        } else if (window.URL != undefined) { // mozilla(firefox)
            url = window.URL.createObjectURL(file);
        } else if (window.webkitURL != undefined) { // webkit or chrome
            url = window.webkitURL.createObjectURL(file);
        }
        return url;
    }
</script>
</block>